<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>清除浮动</title>
    <style>
        .papa {
            background: lightblue;
            /*height: 300px;*/
            display: block;
            overflow: hidden;
            clear: both;
        }

        .child {
            background-color: green;
            width: 200px;
            height: 200px;
            float: left;
        }
    </style>
</head>

<body>
<div class="papa">
    <div class="child"></div>
</div>
</body>

</html>
